package com.xh.baselibrary.http.interfaces

import com.xh.baselibrary.http.Request
import com.xh.baselibrary.http.Response
import com.xh.baselibrary.http.interfaces.callback.OnNetCallback

interface IPost {
    /**
     * POST请求
     *
     * @param url      请求地址，该参数不能用空
     * @param params   post提交的参数，该参数不能用空
     * @param listener 回调接口，默认为空
     */
    fun post(url: String, params: HashMap<String, String>, listener: com.xh.baselibrary.http.interfaces.callback.OnNetCallback<Response>? = null): Request<OnNetCallback<Response>, Response>

    /**
     * POST请求
     * @param url       请求地址，该参数不能用空
     * @param param     post提交的JSON参数
     * @param listener  回调接口，默认为空
     */
    fun postJson(url: String, json: String, listener: com.xh.baselibrary.http.interfaces.callback.OnNetCallback<Response>? = null): Request<com.xh.baselibrary.http.interfaces.callback.OnNetCallback<Response>, Response>

    /**
     * POST请求
     * @param url       请求地址，该参数不能用空
     * @param param     post提交的JSON参数
     * @param listener  回调接口，默认为空
     */
    fun postText(url: String, text: String, listener: com.xh.baselibrary.http.interfaces.callback.OnNetCallback<Response>? = null): Request<com.xh.baselibrary.http.interfaces.callback.OnNetCallback<Response>, Response>

    /**
     * POST请求
     *
     * @param url        请求地址，该参数不能用空
     * @param param      post提交的参数类型，该参数不能用空，见`https://tools.ietf.org/html/rfc2045`
     * @param mediaType  post提交的参数，该参数不能用空
     * @param listener   回调接口，默认为空
     */
    fun post(url: String, mediaType: String, param: String, listener: com.xh.baselibrary.http.interfaces.callback.OnNetCallback<Response>? = null): Request<com.xh.baselibrary.http.interfaces.callback.OnNetCallback<Response>, Response>


}